//
//  WaitFinishCell.m
//  Yearly Plan
//
//  Created by admin on 2019/2/28.
//  Copyright © 2019年 admin. All rights reserved.
//

#import "WaitFinishCell.h"

@implementation WaitFinishCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        
        self.bgView = [UIView new];
        self.bgView.backgroundColor = [UIColor whiteColor];
        self.bgView.layer.cornerRadius = kWidth(8);
        [self addShadowToView:self.bgView withColor:[UIColor lightGrayColor]];
        [self.contentView addSubview:self.bgView];
        [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView).offset(kHeight(20));
            make.left.equalTo(self.contentView).offset(kWidth(15));
            make.bottom.equalTo(self.contentView).offset(kHeight(-20));
            make.right.equalTo(self.contentView).offset(kWidth(-15));;
        }];
        
        self.eidtBtn = [UIButton new];
        [self.eidtBtn setTitle:@"complete" forState:UIControlStateNormal];
        [self.eidtBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateNormal];
        self.eidtBtn.titleLabel.font = RegularMiddelFont;
        [self.bgView addSubview:self.eidtBtn];
        [self.eidtBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.bgView).offset(kHeight(3));
            make.right.equalTo(self.bgView).offset(kWidth(-8));
        }];
        
        self.infoLab = [UILabel new];
        self.infoLab.text = @"slkafjasdflsdjfkfsdfasdfasdfasfasfasdfaasadfasfasafasflsdf";
        self.infoLab.font = RegularDefaultFont;
        self.infoLab.numberOfLines = 0;
        self.infoLab.textColor = [UIColor darkGrayColor];
        [self.bgView addSubview:self.infoLab];
        [self.infoLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.eidtBtn.mas_bottom).offset(kHeight(2));
            make.left.equalTo(self.bgView).offset(kWidth(15));
            make.right.equalTo(self.bgView).offset(kWidth(-15));
        }];
        
        self.titleImg = [UIImageView new];
        self.titleImg.backgroundColor = HEX_COLOR(0xF7CE47);
        [self.bgView addSubview:self.titleImg];
        [self.titleImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.bgView).offset(kWidth(-3));
            make.centerY.equalTo(self.bgView);
            make.size.mas_equalTo(CGSizeMake(kWidth(5), kHeight(15)));
        }];
    }
    return self;
}


- (void)addShadowToView:(UIView *)theView withColor:(UIColor *)theColor {
    // 阴影颜色
    theView.layer.shadowColor = theColor.CGColor;
    // 阴影偏移，默认(0, -3)
    theView.layer.shadowOffset = CGSizeMake(0,0);
    // 阴影透明度，默认0
    theView.layer.shadowOpacity = 0.5;
    // 阴影半径，默认3
    theView.layer.shadowRadius = 5;
}


@end
